<template></template>

<script setup lang="ts">
import { reactive, ref, toRef,toRefs } from "vue";

let person = reactive({ name: "zs", address: "hefei" });
console.log(person);

// 1 这样写丢失响应式了
// let {name,address} = person;

// 2 保留响应式写法1
let name = toRef(person,'name');
let address = toRef(person,'address');

// 3 保留响应式写法2
// let {name,address} = toRefs(person);


// 输出
console.log("na=",name)
console.log("add=",address)




</script>